//
//  WYCOpinionController.m
//  51信用卡
//
//  Created by 中企互联 on 2017/11/2.
//  Copyright © 2017年 中企互联. All rights reserved.
//

#import "WYCOpinionController.h"
#import "MXPhotoView.h"

@interface WYCOpinionController ()

@end

@implementation WYCOpinionController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    //seyupNav
    [self setupNav];
    
    
    //上传图片
    [self setupPhoto];
}

#pragma make -------->>上传图片
- (void)setupPhoto{
    
    UITextView * texView = [[UITextView alloc] init];
    texView.frame = CGRectMake(0, NavHeight, ScreenWidth, 700 * px);
    texView.editable = YES; // 默认YES
    texView.font = [UIFont systemFontOfSize:MiddleFont];
    texView.text = @"  请输入您遇到的问题或建议...";
    texView.textColor = [UIColor grayColor];
    texView.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:texView];
    
    UIView * backView = [[UIView alloc] init];
    backView.frame = CGRectMake(0, CGRectGetMaxY(texView.frame), ScreenWidth, 300 * px);
    backView.backgroundColor = WYCGlobalBg;
    [self.view addSubview:backView];
    
    self.edgesForExtendedLayout = UIRectEdgeNone;
    MXPhotoView *photoView = [[MXPhotoView alloc] init];
    photoView.photoViewDele = self;
    photoView.frame = CGRectMake(0, 0, ScreenWidth, 300 * px);
    photoView.backgroundColor = [UIColor whiteColor];
    photoView.isNeedMovie = YES;
    photoView.showNum = 4;
    [backView addSubview:photoView];
    
    
    UITextField * texfield = [[UITextField alloc] init];
    texfield.frame = CGRectMake(0, CGRectGetMaxY(backView.frame) + 40 * px, ScreenWidth, 150 * px);
    texfield.backgroundColor = [UIColor whiteColor];
    texfield.placeholder = @"      手机号/邮箱(选填)，方便我们联系您";
    [self.view addSubview:texfield];
    
    
    //注册按钮
    UIButton * loginButton = [[UIButton alloc] init];
    loginButton.frame = CGRectMake(40 * px, CGRectGetMaxY(texfield.frame) + 150 * px, ScreenWidth - 80 * px, 150 * px);
    loginButton.backgroundColor = WYCMain;
    loginButton.layer.cornerRadius = 3;
    [loginButton setTitle:@"提交" forState:UIControlStateNormal];
    loginButton.titleLabel.font = [UIFont systemFontOfSize:72 * px];
    [loginButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [loginButton addTarget:self action:@selector(RegisterClick) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:loginButton];
}
- (void)RegisterClick{
    [self showToast:@"反馈意见成功"];
    [self.navigationController popViewControllerAnimated:NO];
}
- (void)setupNav {
    //    self.navigationItem.title = @"意见反馈";
    //    [self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]}];
    //    [self.navigationController.navigationBar setBarTintColor:WYCMain];
    
    self.view.backgroundColor = WYCGlobalBg;
}
- (void)viewWillAppear:(BOOL)animated {
    
    [super viewWillAppear:animated];
    
    
    
    self.navigationController.navigationBar.hidden = YES;
    
    
    UIView * NavView = [[UIView alloc] init];
    NavView.frame = CGRectMake(0, 0, ScreenWidth, NavHeight);
    NavView.backgroundColor = WYCmainColor;
    [self.view addSubview:NavView];
    
    
    
    CALayer *bottomLineLayer = [[CALayer alloc] init];
    bottomLineLayer.frame = CGRectMake(0, NavView.bounds.size.height - 0.5, NavView.bounds.size.width, 0.5);
    bottomLineLayer.backgroundColor = WYCmainColor.CGColor;
    [NavView.layer addSublayer:bottomLineLayer];
    
    
    
    
    
    //返回按钮
    UIButton *  fanhuibutton = [[UIButton alloc] init];
    [fanhuibutton setImage:[UIImage imageNamed:@"Nav_back"] forState:UIControlStateNormal];
    [fanhuibutton addTarget:self action:@selector(backClick) forControlEvents:UIControlEventTouchUpInside];
    fanhuibutton.frame = CGRectMake(30 * px, titleY, 66 * px , 66 * px);
    [NavView addSubview:fanhuibutton];
    
    
    UILabel * NavRigsterLabel = [[UILabel alloc] init];
    NavRigsterLabel.frame = CGRectMake(0, titleY, NavView.width, 68 * px);
    NavRigsterLabel.textColor = [UIColor whiteColor];
    NavRigsterLabel.font = [UIFont boldSystemFontOfSize:BigFont];
    NavRigsterLabel.textAlignment = NSTextAlignmentCenter;
    NavRigsterLabel.text = @"意见反馈";
    [NavView addSubview:NavRigsterLabel];
}
- (void)backClick{
    
    [self.navigationController popViewControllerAnimated:YES];
}
@end

